/**
 */
package org.karelun.rabbit.graph.impl;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.internal.cdo.CDOObjectImpl;

import org.karelun.rabbit.graph.Connection;
import org.karelun.rabbit.graph.GraphPackage;
import org.karelun.rabbit.graph.Rectangled;
import org.karelun.rabbit.graph.Shape;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Shape</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.karelun.rabbit.graph.impl.ShapeImpl#getText <em>Text</em>}</li>
 *   <li>{@link org.karelun.rabbit.graph.impl.ShapeImpl#getX <em>X</em>}</li>
 *   <li>{@link org.karelun.rabbit.graph.impl.ShapeImpl#getY <em>Y</em>}</li>
 *   <li>{@link org.karelun.rabbit.graph.impl.ShapeImpl#getWidth <em>Width</em>}</li>
 *   <li>{@link org.karelun.rabbit.graph.impl.ShapeImpl#getHeight <em>Height</em>}</li>
 *   <li>{@link org.karelun.rabbit.graph.impl.ShapeImpl#getSourceConnections <em>Source Connections</em>}</li>
 *   <li>{@link org.karelun.rabbit.graph.impl.ShapeImpl#getTargetConnections <em>Target Connections</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ShapeImpl extends CDOObjectImpl implements Shape {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ShapeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return GraphPackage.Literals.SHAPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected int eStaticFeatureCount() {
		return 0;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getText() {
		return (String)eGet(GraphPackage.Literals.TEXTED__TEXT, true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setText(String newText) {
		eSet(GraphPackage.Literals.TEXTED__TEXT, newText);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getX() {
		return (Integer)eGet(GraphPackage.Literals.RECTANGLED__X, true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setX(int newX) {
		eSet(GraphPackage.Literals.RECTANGLED__X, newX);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getY() {
		return (Integer)eGet(GraphPackage.Literals.RECTANGLED__Y, true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setY(int newY) {
		eSet(GraphPackage.Literals.RECTANGLED__Y, newY);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getWidth() {
		return (Integer)eGet(GraphPackage.Literals.RECTANGLED__WIDTH, true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setWidth(int newWidth) {
		eSet(GraphPackage.Literals.RECTANGLED__WIDTH, newWidth);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getHeight() {
		return (Integer)eGet(GraphPackage.Literals.RECTANGLED__HEIGHT, true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setHeight(int newHeight) {
		eSet(GraphPackage.Literals.RECTANGLED__HEIGHT, newHeight);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	public EList<Connection> getSourceConnections() {
		return (EList<Connection>)eGet(GraphPackage.Literals.SHAPE__SOURCE_CONNECTIONS, true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	public EList<Connection> getTargetConnections() {
		return (EList<Connection>)eGet(GraphPackage.Literals.SHAPE__TARGET_CONNECTIONS, true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
		if (baseClass == Rectangled.class) {
			switch (derivedFeatureID) {
				case GraphPackage.SHAPE__X: return GraphPackage.RECTANGLED__X;
				case GraphPackage.SHAPE__Y: return GraphPackage.RECTANGLED__Y;
				case GraphPackage.SHAPE__WIDTH: return GraphPackage.RECTANGLED__WIDTH;
				case GraphPackage.SHAPE__HEIGHT: return GraphPackage.RECTANGLED__HEIGHT;
				default: return -1;
			}
		}
		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
		if (baseClass == Rectangled.class) {
			switch (baseFeatureID) {
				case GraphPackage.RECTANGLED__X: return GraphPackage.SHAPE__X;
				case GraphPackage.RECTANGLED__Y: return GraphPackage.SHAPE__Y;
				case GraphPackage.RECTANGLED__WIDTH: return GraphPackage.SHAPE__WIDTH;
				case GraphPackage.RECTANGLED__HEIGHT: return GraphPackage.SHAPE__HEIGHT;
				default: return -1;
			}
		}
		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
	}

} //ShapeImpl
